/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.wiredsys.credcheck.dao.intf;

import java.io.Serializable;
import java.util.List;
import org.hibernate.HibernateException;

/**
 *
 * @author ppacheco
 * @param <T>
 * @param <ID>
 */
public interface GenericDAOIntf<T, ID extends Serializable> extends Serializable {

    /**
     *
     * @param t
     * @return
     * @throws HibernateException
     * @throws InstantiationException
     */
    public ID save(Object t) throws HibernateException, InstantiationException;

    /**
     *
     * @param t
     * @throws HibernateException
     * @throws InstantiationException
     */
    public void saveOrUpdate(Object t) throws HibernateException, InstantiationException;

    /**
     *
     * @param t
     * @throws HibernateException
     * @throws InstantiationException
     */
    public void delete(Object t) throws HibernateException, InstantiationException;

    /**
     *
     * @param t
     * @param id
     * @param lock
     * @return
     * @throws HibernateException
     * @throws InstantiationException
     */
    public Object findByID(Object t, ID id, boolean lock) throws HibernateException, InstantiationException;

    /**
     *
     * @param t
     * @return
     * @throws HibernateException
     * @throws InstantiationException
     */
    public List<T> findAll(Object t) throws HibernateException, InstantiationException;
}
